package org.example.lotterysystem.controller.param;

import jakarta.validation.Valid;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;

import java.io.Serializable;
import java.util.List;
import java.util.Objects;

public class CreateActivityParam implements Serializable {
    /**
     * 活动名
     */
    @NotBlank(message = "活动名称不能为空！")
    private String activityName;

    /**
     * 描述信息
     */
    @NotBlank(message = "活动描述不能为空！")
    private String description;

    /**
     * 活动关联奖品列表
     */
    @NotEmpty(message = "活动关联奖品列表不能为空！")
    @Valid
    private List<CreatePrizeByActivityParam> activityPrizeList;
    /**
     * 活动关联人员列表
     */
    @NotEmpty(message = "活动关联人员列表不能为空！")
    @Valid
    private List<CreateUserByActivityParam> activityUserList;

    public String getActivityName() {
        return activityName;
    }

    public void setActivityName(String activityName) {
        this.activityName = activityName;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public List<CreatePrizeByActivityParam> getActivityPrizeList() {
        return activityPrizeList;
    }

    public void setActivityPrizeList(List<CreatePrizeByActivityParam> activityPrizeList) {
        this.activityPrizeList = activityPrizeList;
    }

    public List<CreateUserByActivityParam> getActivityUserList() {
        return activityUserList;
    }

    public void setActivityUserList(List<CreateUserByActivityParam> activityUserList) {
        this.activityUserList = activityUserList;
    }

    @Override
    public boolean equals(Object object) {
        if (this == object) return true;
        if (object == null || getClass() != object.getClass()) return false;
        CreateActivityParam that = (CreateActivityParam) object;
        return Objects.equals(activityName, that.activityName) && Objects.equals(description, that.description) && Objects.equals(activityPrizeList, that.activityPrizeList) && Objects.equals(activityUserList, that.activityUserList);
    }

    @Override
    public int hashCode() {
        return Objects.hash(activityName, description, activityPrizeList, activityUserList);
    }
}
